package com.xzzz.irda.guardcat.core.metric.tomcat;

/**
 * Tomcat 协议处理器信息
 *
 * @author xzzz
 * @since 1.0.0
 */
public class TomcatProtocolHandlerInfo {

    /**
     * 同一时间服务器接受并处理的最大连接数。
     */
    private Integer maxConnections;

    /**
     * 当前连接数
     */
    private Long connectionCount;

    /**
     * 最大请求队列长度
     */
    private Integer acceptCount;

    /**
     * 等待处理数量
     */
    private Integer waitingProcessorCount;

    /**
     * 连接器在接受连接后将等待呈现请求 URI 行的毫秒数。
     *      使用值 -1 表示没有（即无限）超时。默认值为 60000（即 60 秒）。
     *      Tomcat 附带的标准 server.xml 将其设置为 20000（即 20 秒）。
     *      除非 disableUploadTimeout 设置为 false，否则在读取请求正文（如果有）时也会使用此超时。
     *      通常情况下设置为30000 或 20000。
     */
    private Integer connectionTimeout;

    /**
     * 最大请求处理线程数
     *      默认值 200 。
     */
    private Integer maxThreads;

    /**
     * 最小备用请求处理线程数【核心线程数】  默认值 10 。
     */
    private Integer minSpareThreads;

    public Integer getMaxConnections() {
        return maxConnections;
    }

    public void setMaxConnections(Integer maxConnections) {
        this.maxConnections = maxConnections;
    }

    public Long getConnectionCount() {
        return connectionCount;
    }

    public void setConnectionCount(Long connectionCount) {
        this.connectionCount = connectionCount;
    }

    public Integer getAcceptCount() {
        return acceptCount;
    }

    public void setAcceptCount(Integer acceptCount) {
        this.acceptCount = acceptCount;
    }

    public Integer getWaitingProcessorCount() {
        return waitingProcessorCount;
    }

    public void setWaitingProcessorCount(Integer waitingProcessorCount) {
        this.waitingProcessorCount = waitingProcessorCount;
    }

    public Integer getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(Integer connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public Integer getMaxThreads() {
        return maxThreads;
    }

    public void setMaxThreads(Integer maxThreads) {
        this.maxThreads = maxThreads;
    }

    public Integer getMinSpareThreads() {
        return minSpareThreads;
    }

    public void setMinSpareThreads(Integer minSpareThreads) {
        this.minSpareThreads = minSpareThreads;
    }

    @Override
    public String toString() {
        return "TomcatProtocolHandlerInfo{" +
                "maxConnections=" + maxConnections +
                ", connectionCount=" + connectionCount +
                ", acceptCount=" + acceptCount +
                ", waitingProcessorCount=" + waitingProcessorCount +
                ", connectionTimeout=" + connectionTimeout +
                ", maxThreads=" + maxThreads +
                ", minSpareThreads=" + minSpareThreads +
                '}';
    }
}
